import request from '@/utils/request'

// 查询用户模块列表
export function listUserModule(query) {
  return request({
    url: '/manage-api/business/user-module/list',
    method: 'get',
    params: query
  })
}

export function monitorListUserModule(query) {
  return request({
    url: '/admin-api/business/user-module/monitor/list',
    method: 'get',
    params: query
  })
}

export function monitor2ListUserModule(query) {
  return request({
    url: '/business/userModule/monitor2/list',
    method: 'get',
    params: query
  })
}

// 查询用户模块详细
export function getUserModule(userModuleId) {
  return request({
    url: '/manage-api/business/user-module/' + userModuleId,
    method: 'get'
  })
}

export function getMonitorUserModule(userModuleId) {
  return request({
    url: '/manage-api/business/user-module/monitor/' + userModuleId,
    method: 'get'
  })
}

// export function synchronousAddress(userModuleId) {
//   return request({
//     url: '/business/userModule/synchronousAddress/',
//     method: 'post',
//     data: userModuleId
//   })
// }

// 新增用户模块
export function addUserModule(data) {
  return request({
    url: '/manage-api/business/user-module',
    method: 'post',
    data: data
  })
}

// 修改用户模块
export function updateUserModule(data) {
  return request({
    url: '/manage-api/business/user-module',
    method: 'put',
    data: data
  })
}

// 删除用户模块
export function delUserModule(userModuleId) {
  return request({
    url: '/manage-api/business/user-module/' + userModuleId,
    method: 'delete'
  })
}

export function selectUserModuleIndexInfo(query) {
  return request({
    url: '/admin-api/business/user-module/company-overview',
    method: 'get',
    params: query
  })
}

export function selectUserModuleHistoryData(query) {
  return request({
    url: '/business/userModule/selectUserModuleHistoryData',
    method: 'get',
    params: query
  })
}

// 经销商概览所有项目
export function getOverviewAllProject(query) {
    return request({
        url: '/admin-api/business/user-module/company-overview',
        method: 'get',
        params: query
    })
}
